<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<p>正则验证。safari不支持</p>
	<form>
		<input type="text" placeholder="请输入1-5个纯数字" pattern="\d{1,5}" />
		<input type="submit" />
	</form>
</body>
</html>